﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ePioneer_ep_question : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string id=Request["id"];
        string userId = Request["userId"];
        IsUserEndAnswer(id,userId);
    }

    /// <summary>
    /// 判断是否可以对回答进行评价
    /// </summary>
    /// <param name="id"></param>
    /// <param name="userId"></param>
    /// <returns></returns>
    
    //public static void IsSubmit(int id, int userId)
    //{
    //    ePioneer_ep_question e = new ePioneer_ep_question();
    //    return e.IsUserEndAnswer(id, userId);
    //}

    /// <summary>
    /// 判断是否可以对回答进行评价
    /// </summary>
    /// <returns></returns>
    public void IsUserEndAnswer(string id, string userId)
    {
        string bz = "true";
        List<string> answerId = new List<string>();
        if (Session["IsUserEndAnswer"] != null)
        {
            answerId = Session["IsUserEndAnswer"] as List<string>;
            if (answerId.Contains(userId + "," + id))
            {
                bz="false";
            }
        }
        answerId.Add(userId + "," + id);
        Session["IsUserEndAnswer"] = answerId;
        Response.Write(bz);
    }
}